package collector.util;


public class BeanUtils {
    
    private BeanUtils() {
    }

    @SuppressWarnings("unchecked")
    public static Class loadClass(String className) {
        Class cls = null;
        try {
            cls = BeanUtils.class.getClassLoader().loadClass(className);
        } catch (Exception e) {
            try {
                cls = Class.forName(className);
            } catch (Exception f) {
            }
        }
        return cls;
    }

    public static <T> T loadInstance(Class<T> cls) {
        try {
            return cls.newInstance();
        } catch (Exception e) {
            return null;
        }
    }
}
